package com.xm;

/**
 * @Author：xm
 * @Project：runoob
 * @Date：2024/7/9 14:56
 */

public class Animal01 {
    private String name;
    private int id;

    public Animal01(String myName, int myId) {
        name = myName;
        id = myId;
        System.out.println("父类Animal01的有参构造...");
    }

    public Animal01() {
        System.out.println("父类Animal01的无参构造...");
    }

    public void eat() {
        System.out.println(name + "正在吃");
    }

    public void sleep() {
        System.out.println(name + "真在睡觉");
    }

    public void introduction() {
        System.out.println("大家好，我是" + id + "号" + name);
    }
}
